using System;
using System.ComponentModel;
using System.Collections.Generic;
using Sinacor.Servico.Bovespa.Ordens.Service.DataContract.Response;
using Sinacor.Servico.Bovespa.Ordens.BusinessEntity;


using Sinacor.Servico.Bovespa.Ordens;

namespace Sinacor.Servico.Bovespa.Ordens.Service.ServiceImplementation.Translator
{
    public static class TranslateBetweenBolsaAndBolsaResponse
    {
        public static DataContract.Response.BolsaResponse TranslateBolsaToBolsaResponse(BusinessEntity.Bolsa from)
        {
            
            if (from == null) return null;

            DataContract.Response.BolsaResponse to = new DataContract.Response.BolsaResponse();
            to.Codigo = from.Codigo;
            to.Descricao = from.Descricao;
            return to;
        }

        /// <summary>
        /// Autor: Eduardo Sertorio
        /// Data: 19/01/2008
        /// </summary>
        /// <param name="from"></param>
        /// <returns></returns>
        public static List<DataContract.Response.BolsaResponse> TranslateBolsaListToBolsaResponseList(List<BusinessEntity.Bolsa> from)
        {
            List<DataContract.Response.BolsaResponse> to = new List<DataContract.Response.BolsaResponse>();
            foreach(BusinessEntity.Bolsa beOrdemItem in from)
            {
                to.Add(TranslateBolsaToBolsaResponse(beOrdemItem));
            }
            return to;
        }
    }
}

